import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {BodyComponent} from './body/body.component';
import {MovieListComponent} from './movie-list/movie-list.component';
import {NotFoundComponentComponent} from './not-found-component/not-found-component.component';
import {ActorListComponent} from './actor-list/actor-list.component';
import {MovieDetailComponent} from './detail/movie-detail.component';
import {PersonDetailComponent} from './person-detail/person-detail.component';
import {NewsListComponent} from './news-list/news-list.component';
import {NewsDetailComponent} from './news-detail/news-detail.component';
import {SearchListComponent} from './search-list/search-list.component';

const routes: Routes = [
  {
    path: '', component: BodyComponent
  },
  {
    path: 'movie', children: [
      {path: 'list', component: MovieListComponent},
      {path: 'detail/:id', component: MovieDetailComponent},
      {path: 'search', component: SearchListComponent},
    ]
  },
  {
    path: 'person', children: [
      {path: 'detail/:id', component: PersonDetailComponent}
    ]
  },
  {
    path: 'actor', children: [
      {path: 'list', component: ActorListComponent}
    ]
  },
  {
    path: 'news', children: [
      {path: 'list', component: NewsListComponent},
      {path: 'detail/:id', component: NewsDetailComponent},
    ]
  },
  {
    path: '**', component: NotFoundComponentComponent
  },

];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class MovieRoutingModule {
}
